package com.coincalf.mapper;

import com.coincalf.dto.CoinInfoDto;
import com.coincalf.entity.Coin;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * <p>
 * 币种配置信息 Mapper 接口
 * </p>
 *
 * @author qiang
 * @since 2018-05-12
 */
public interface CoinMapper extends BaseMapper<Coin> {

    /**
     * 根据币种名称查询RPC节点URL
     *
     * @param coinName
     * @return
     */
    String selectServerUrl(String coinName);

    Coin selectInfo(@Param("coinName") String coinName);

    public List<CoinInfoDto> selectContractAddressesByMainCoinId(@Param("mainCoinId") Long mainCoinId);

    public Long selectMainCoinIdByCoinId(@Param("coinId") Long coinId);

    public String selectCoinNameByCoinId(@Param("coinId") Long coinId);
}
